<template>
  <div class="gold absolute">
    <div class="back">
      <img src="http://diandian.zgkpz.com/images/user/back.png" @click="back" />
    </div>
    <div class="main">
      <div class="header">
        <h2>
          <img
            src="http://diandian.zgkpz.com/images/m_gold/jinbishangcheng.png"
          />
        </h2>
        <p>我的金币</p>
        <p><span>30285</span>（币）</p>
      </div>
      <div class="middle">
        <div class="left">
          <div class="wenzi">
            <p class="wenzi_p1">兑换明细</p>
            <p class="wenzi_p2">点击查看</p>
          </div>
        </div>
        <div class="right">
          <div class="wenzi">
            <p class="wenzi_p1">金币记录</p>
            <p class="wenzi_p2">点击查看</p>
          </div>
        </div>
      </div>

      <div class="product">
        <ul>
          <li>
            <img src="http://diandian.zgkpz.com/images/m_gold/product.png" />
          </li>
          <li>
            <img src="http://diandian.zgkpz.com/images/m_gold/product.png" />
          </li>
          <li>
            <img src="http://diandian.zgkpz.com/images/m_gold/product.png" />
          </li>
          <li>
            <img src="http://diandian.zgkpz.com/images/m_gold/product.png" />
          </li>
          <li>
            <img src="http://diandian.zgkpz.com/images/m_gold/product.png" />
          </li>
        </ul>
      </div>
    </div>

    <div class="menu">
      <div>
        <img
          src="http://diandian.zgkpz.com/images/m_gold/read.png"
          class="menu_img"
          @click="read"
        />
      </div>
      <div>
        <img
          src="http://diandian.zgkpz.com/images/m_gold/huiben.png"
          class="menu_img"
          @click="huiben"
        />
      </div>
      <div>
        <img
          src="http://diandian.zgkpz.com/images/m_gold/my.png"
          class="menu_img"
          @click="my"
        />
      </div>
    </div>
  </div>
</template>
<script>
export default {
  name: "Index",
  data: function () {
    return {
      screenWidth: document.body.clientWidth,
    };
  },
  created() {
    window.addEventListener("resize", this.handleResize);
  },
  mounted: function () {},
  methods: {
    handleResize() {
      if (document.body.clientWidth > 770) {
        this.$router.replace({ path: "/web/gold" });
      }
    },
    back() {
      this.$router.replace({ path: "/main" });
    },
    read() {
      this.$router.replace({ path: "/" });
    },
    huiben() {
      this.$router.replace({ path: "/main" });
    },
    my() {
      this.$router.replace({ path: "/my" });
    },
  },
};
</script>
<style scoped>
.code img {
  width: 100%;
  height: 100%;
}
.back img {
  width: 0.75rem;
  position: absolute;
  top: 2%;
  left: 3%;
}
.main {
  font-family: SimHei;
}
.main .header {
  width: 90%;
  height: 2.7rem;
  margin-left: 5%;
  margin-top: 0.6rem;
  text-align: center;
  line-height: 0.6rem;
  background: url("http://diandian.zgkpz.com/images/m_gold/header.png")
    no-repeat;
  background-size: 100%100%;
}
.main .header p {
  color: #ffffff;
  font-size: 0.3rem;
}
.main .header img {
  width:2rem;
}
.main .header span {
  color: #fff53a;
  font-size: 0.45rem;
}
.main h2 {
  padding-top: 0.8rem;
  font-size: 0.85rem;
  color: #ffa25d;
}
.middle {
  text-align: center;
  width: 100%;
  display: inline-flex;
  justify-content: space-around;
  margin-top: 0.2rem;
}
.left {
  background: url("http://diandian.zgkpz.com/images/m_gold/left.png") no-repeat;
  background-size: 100%;
  width: 3rem;
  height: 2rem;
}
.right {
  background: url("http://diandian.zgkpz.com/images/m_gold/right.png") no-repeat;
  background-size: 100%;
  width: 3rem;
  height: 2rem;
}
.wenzi {
  color: #ffffff;
  margin-right: 1.2rem;
  margin-top: 0.3rem;
  line-height: 0.45rem;
  text-align: left;
  margin-left: 0.3rem;
}
.wenzi_p1 {
  font-size: 0.28rem;
}
.wenzi_p2 {
  font-size: 0.025rem;
}
.product {
  width: 6.5rem;
  height: 6.3rem;
  background: #ffffff;
  margin: 0 0.5rem;
  overflow-y: auto;
  border-radius: 3px;
}
.product ul {
  width: 100%;
  float: left;
}
.product ul li {
  width: 25%;
  float: left;
}
.product ul li:nth-child(2n) {
  margin: 0 1.6rem;
}
.product ul li img {
  width: 3.2rem;
  padding: 0.07rem;
}
.menu {
  background: url("http://diandian.zgkpz.com/images/m_index/white.png")
    no-repeat;
  background-size: cover;
  width: 100%;
  display: flex;
  justify-content: space-around;
  margin-top: 0.35rem;
  position: fixed;
  bottom: 0;
}
.menu_img {
  width: 1rem;
  height: 1rem;
  position: relative;
  bottom: 0;
}
</style>
